package com.shiro.sdk.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties
@ConfigurationProperties(prefix = "shiro.jwt")
public class JwtProperties {

    /**
     * jwt 的签发者 默认为 trj
     */
    private String jwtIssuer = "trj";

    /**
     * jwt 的主题 默认为 jwtAuthToken
     */
    private String jwtSubject = "jwtAuthToken";


    /**
     * jwt token 过期秒数
     */
    private Integer tokenExpireSeconds;

    /**
     * jwt token 刷新秒数，表示 是否已经发布了 tokenRefreshSeconds 秒，如果超过就刷新一个新的token给前端
     */
    private Integer tokenRefreshSeconds;

    /**
     * 签名秘钥
     */
    private String secretKey;

    public String getJwtIssuer() {
        return jwtIssuer;
    }

    public void setJwtIssuer(String jwtIssuer) {
        this.jwtIssuer = jwtIssuer;
    }

    public String getJwtSubject() {
        return jwtSubject;
    }

    public void setJwtSubject(String jwtSubject) {
        this.jwtSubject = jwtSubject;
    }

    public String getSecretKey() {
        return secretKey;
    }

    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }

    public Integer getTokenExpireSeconds() {
        return tokenExpireSeconds;
    }

    public void setTokenExpireSeconds(Integer tokenExpireSeconds) {
        this.tokenExpireSeconds = tokenExpireSeconds;
    }

    public Integer getTokenRefreshSeconds() {
        return tokenRefreshSeconds;
    }

    public void setTokenRefreshSeconds(Integer tokenRefreshSeconds) {
        this.tokenRefreshSeconds = tokenRefreshSeconds;
    }
}
